package com.dididoctor.patient.Receive;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.Observer;
import com.netease.nimlib.sdk.msg.SystemMessageObserver;
import com.netease.nimlib.sdk.msg.model.SystemMessage;

public class NoticeReciver extends BroadcastReceiver {
    @Override       //静态广播接收器执行的方法
    public void onReceive(Context context, Intent intent) {
//        String msg = intent.getStringExtra("msg");
//        Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
        Toast.makeText(context, "进入广播接收器", Toast.LENGTH_SHORT).show();
        NIMClient.getService(SystemMessageObserver.class)
                .observeReceiveSystemMsg(new Observer<SystemMessage>() {
                    @Override
                    public void onEvent(SystemMessage message) {
                        Log.e(">>>>>", "!!!!!!!!!!!!!!!!!!!!");
                    }
                }, false);
    }
}